package org.dtrd.modules.content.articles.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.dtrd.modules.content.articles.entity.po.DtrdExtEmsYwTips;
import org.dtrd.modules.content.articles.mapper.DtrdExtEmsYwTipsMapper;
import org.dtrd.modules.content.articles.service.IDtrdExtEmsYwTipsService;
import org.springframework.stereotype.Service;

/**
 * @author 萧
 * @date 2021-08-25 17:37:47
 **/
@Service
@DS("multi-datasource1")
public class DtrdExtEmsYwTipsServiceImpl extends ServiceImpl<DtrdExtEmsYwTipsMapper, DtrdExtEmsYwTips> implements IDtrdExtEmsYwTipsService {

    @Override
    public String getTipsById(Integer dataId) {
        LambdaQueryWrapper<DtrdExtEmsYwTips> queryMapper = new LambdaQueryWrapper<>();
        queryMapper.eq(DtrdExtEmsYwTips::getDataId,dataId);
        DtrdExtEmsYwTips tips = baseMapper.selectOne(queryMapper);
        return tips == null ? null : tips.getTipContent();
    }
}
